home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 23 / minix.zip / MINIX3.MSG < prev   
Internet Message Format  |  1980-01-01  |  15KB

  1. Path: think!husc6!seismo!mcvax!botter!ast
  2. From: ast@botter.cs.vu.nl (Andy Tanenbaum)
  3. Newsgroups: comp.sys.amiga,comp.sys.atari.st,comp.sys.ibm.pc,comp.sys.mac
  4. Subject: MINIX - From the mouth of the horse
  5. Message-ID: <1026@botter.cs.vu.nl>
  6. Date: 8 Jan 87 23:11:03 GMT
  7. Reply-To: ast@cs.vu.nl (Andy Tanenbaum)
  8. Distribution: world
  9. Organization: VU Informatica, Amsterdam
  10. Lines: 255
  11. Xref: think comp.sys.amiga:1299 comp.sys.atari.st:738 comp.sys.ibm.pc:850 comp.sys.mac:672
  12.  
  13. I have just learned of quite a discussion going on in comp.sys.atari about
  14. porting MINIX to the Atari.  For all I know a similar discussion is going on
  15. in comp.sys.amiga and elsewhere.  I am cross posting this to several groups
  16. in case there are people there who are interested in porting MINIX to their
  17. machine.  If you missed the original note in mod.os.unix, I have just written
  18. a UNIX clone that is available now with all the SOURCE CODE for $79.95 from
  19. Prentice-Hall.  There is also a book telling how it works inside.
  20. I suggest that subsequent discussion go on in comp.sys.ibm.pc to avoid 
  21. scattering it all over the place.  At the very least, crosspost comments to 
  22. comp.sys.ibm.pc under the subject MINIX. Later, we can set up comp.os.minix
  23. if there is enough interest.
  24.  
  25. Read the comp.sys.atari group under the heading Forwarded for the last 2 weeks
  26. to get the background for this note.
  27.  
  28. Although MINIX is copyright (not licensed), Prentice-Hall has agreed to permit
  29. people to make a LIMITED number of copies for educational use, home study etc.
  30. Posting the source code on the network (54K lines of C, kernel+utilities) is a
  31. no no, but if each purchased copy doesn't generated more than say, 2 or 3 
  32. copies it is ok. While this is not public domain it is a lot better than Lotus,
  33. Microsoft, Borland, and every other software company in the world's policy.
  34.  
  35. About the pricing.  It is clearly not shareware, but by publishing the
  36. source code on diskette, we are clearly not acting like AT&T either.
  37. I had some discussion with people like Brian Kernighan (author of
  38. the Software Tools package) and Doug Comer (author of Xinu, a little
  39. embedded operating system for the LSI-11, although not really UNIX
  40. like) and came to the following conclusion.  I would like to see MINIX become
  41. widespread, so the distribution mechanism is crucial.  Having a major
  42. publisher like Prentice-Hall advertise it, bring it to shows, send out
  43. junk mail, etc. will get it a lot more attention than a note on the
  44. net.  Getting a commercial publisher like Prentice-Hall interested means
  45. charging something.  I think in the long run, this funny, copyrighted
  46. but not real aggressive position we are taking will cause MINIX to become
  47. widespread, new software to be made for it, etc.  The GNU people are
  48. upset because deep in their hearts they, too, know that people would rather
  49. pay a reasonable price for good stuff than get empty promises for free.
  50. Does anyone know how much GNU charges for its "free" software for the tape,
  51. postage, handling etc?    Berkeley generally charges something like $125
  52. for its tapes, as I recall.  If GNU also charges $125 for its "free" software
  53. it seems to me that their moral indignation at Prentice-Hall's outrageous
  54. $79.95 price is somewhat weakened.  I mentioned MINIX in netnews last year
  55. and I got quite a few reactions.  I have also contacted lots of people for
  56. various reasons.  With two exceptions, everybody congratulated me and wished
  57. me good luck.  Some people, especially Martin Atkins, Charles Forsyth, and
  58. Richard Gregg gave me a lot of help, for which I am grateful.  Only two
  59. people were really negative, almost bitter--both from the Free Software
  60. Foundation (names withheld because I don't believe in character assassination
  61. on a world-wide network).  I am tempted to comment further, but I won't.
  62.  
  63. As to the port to the Atari/Amiga/etc as far as I see, there are no technical
  64. problems with the MMU.  The trouble is as follows.  When you fork, the
  65. child has to go somewhere else in memory than where the parent was.
  66. Unfortunately, the child's stack contains absolute addresses, such as
  67. the return from the fork routine.  If the child runs somewhere other
  68. than where the parent was, it will crash.
  69.  
  70. There are a couple of solutions, the simplest of which is this.  When the
  71. child is created, record in the process table where the parent was.
  72. When it is time to run the child, just swap the parent and the child,
  73. and actually run the child where it belongs.  When the parent wants to
  74. run, swap them again.  Although this sounds horrendous,  it is not at all
  75. so bad.  Swapping two 10K programs in memory might take 30 millisec.
  76. MINIX programs are small.  I am a strong believer in Small is Beautiful.
  77. At the end of this note you will find the sizes of the MINIX utilities.
  78. The only big ones are the compiler passes, cpp, cem, opt, cg, and asld.
  79.  
  80. Furthermore, 99.9% of the time, the child does an EXEC, at which point the
  81. operating system can put the parent back where it belongs, and put the
  82. new core image anywhere in memory.  In practice, all this trick will
  83. cost is about two copies of the forked core image, and it doesn't require
  84. modifying the compiler. My experience with fragmentation is that it is not bad.
  85. MINIX doesn't swap because one of the design goals was to have it run on CHEAP
  86. hardware (meaning a 256K PC with 1 floppy disk) and floppies are not ideal as
  87. swapping devices.
  88.  
  89. The MINIX memory management scheme is very simple, because the PC's hardware
  90. is primitive.  A core image consists of the text, the data, a gap, and then the
  91. stack, growing downward.  The stack and the data segments grow into the
  92. gap.  If they meet, BOOM!  In practice, very few programs have wildly
  93. growing stacks or data segments.  I ran some statistics once, and for 90%
  94. of the MINIX utilities, 2K stack is plenty.  On the PC, the text is limited to
  95. 64K, and the data + stack is also limited to 64K.  On a 68000, there would
  96. be no need for such a limit.  It comes from the 8088 architecture.
  97. All you have to do is change a couple of constants in the memory manager.
  98.  
  99. The book is already out.  You should be able to order it at any book store.
  100. The title is Operating Systems: Design and Implementation.  The software 
  101. will be out in three weeks.  It went into production about three weeks ago,
  102. and it takes about six weeks.  Don't ask me why.  Probably the same reason
  103. as why it takes Prentice-Hall 18 months to produce a book from the finished
  104. manuscript (unless you give them camera ready copy, as I do).  If you want to
  105. get the software (either on PC diskettes or 9 track tape), first order the book
  106. and then send back the business reply card (software order form) in the book.
  107.  
  108. I would like to see a MINIX version for the Atari/Amiga/etc.  The 68000 is
  109. clearly much better than the 8088, but the PC has a lot of software going for
  110. it.  Maybe a tolerable UNIX clone might help the Atari/Amiga/etc in its fight
  111. against the monster from 8088-land.  A colleague of mine at Philips has
  112. already started to port MINIX to the Atari.  He is an absolutely top rate
  113. programmer, but he is VERY busy, so he doesn't have much time.  I think he
  114. has already rewritten the MINIX assembly code (low level interrupt
  115. handlers, etc) for the 68000.  I will check with him one of these days; he
  116. seems to be away right now.  What I would like to find is someone who:
  117.  
  118. (1) knows the Atari (Amiga, Macintosh, etc) hardware well 
  119. (2) knows UNIX well on the outside and moderately on the inside
  120. (3) has a substantial amount of free time
  121. (4) has access to an IBM PC for testing things etc.  (not essential, but helps)
  122.  
  123. Perhaps such a person could do the port with a little assistance from me.
  124. Unfortunately I don't have much time either, as Prentice-Hall is bugging me to
  125. revise a book on networks I wrote a million years ago.
  126.  
  127. The main things to do, other than the 68000 assembly code, are the device
  128. drivers, all of which are in C, but of course are totally different for
  129. the PC and Atari etc.  The PC version doesn't use the BIOS at all, because the
  130. stupid thing doesn't use interrupts.  When you start a background job up
  131. and then start up the editor in the foreground, calling the BIOS to read
  132. a character would put the whole computer in a tiny loop sitting and waiting
  133. for the keyboard to produce a character.  MINIX supports the full UNIX
  134. multiprogramming, so I had to write all the drivers from scratch (in C).  I 
  135. suspect that the Atari BIOS isn't any better, although maybe we could use the
  136. screen output BIOS.
  137.  
  138. And here we come back to the $79 again. If the person doing the port does a
  139. good job, Prentice-Hall could sell the other version on diskettes, source code
  140. and all, for the same $79 as the PC version.  I have enough clout with P-H
  141. that I think I could arrange that.  Needless to say, the person doing the
  142. port would be remunerated for his efforts, probably in the form of a royalty
  143. on each disk set sold.  The royalty is typically only a couple of dollars,
  144. but that small amount is why capitalism works and socialism doesn't.
  145.  
  146. If anyone is interested, let me know.  I don't think it will be that difficult,
  147. but you have to plow through much of a very tightly written 719 page book and
  148. understand a 12,000 line program before you can even start, so it will no doubt
  149. be months of work.  Also, debugging operating system code on a bare machine
  150. even a relatively nice one like the 68000, will be a fair amount of work.
  151.  
  152. One other point is the compiler.  The compiler is based on ACK, which is 
  153. described in Communications of the ACM, Sept. 1983, pp. 654-660.  ACK is a big
  154. system for writing compilers.  It is being distributed by UniPress in Edison
  155. NJ and Transmediair in Utrecht, Holland.  It uses the old UNCOL idea of having
  156. front ends that generate a common intermediate code and then back ends that
  157. compile from that code to the target machine.  At present we have front ends
  158. for C, Pascal, Modula 2, Basic, Occam, and even a subset of Ada. There are back
  159. ends for virtually every micro around, from the 6502 to the 68020.  The ACK
  160. software is owned by the university I teach at. UniPress pays them a royalty on
  161. each copy they sell (academic price is $995 for a source tape containing 6
  162. megabytes, although Modula 2 and Occam aren't on the tape yet).  Our department
  163. doesn't have much money, and we use the royalties to allow grad students to go
  164. to conferences and the like.  For these reasons the compiler kit is not part
  165. of MINIX.    Furthermore even the 8088 C compiler source by itself fills 4
  166. diskettes.  If the compiler source were in the MINIX distribution, that would
  167. have meant raising the basic price to over $100, very much against my idea of
  168. keeping the price low. I personally wrote MINIX in my spare time, which is why 
  169. it doesn't have to follow the same rules as ACK.
  170.  
  171. Nevertheless, the source of the 8088 MINIX C compiler is available
  172. as a separate package from UniPress.  I suspect that the easiest way to get
  173. a 68000 C compiler is for someone at a university to have their university buy
  174. the ACK tape and use that to develop the 68000 compiler.  When it is done, it
  175. will be necessary to negotiate a deal with UniPress to allow it to be sold,
  176. but I know Mark Krieger, the president of UniPress, and he is a reasonable guy,
  177. so I am sure some deal can be worked out that won't raise the price too much.
  178. He is on the net (msk@unipress.uucp) if you have questions about all this.
  179.  
  180. The reason that I think this route is the easiest, is that ACK already has a
  181. backend for the 68000, so there isn't much work to be done, but you really
  182. need a VAX or a SUN or something like that to bring up the full ACK development
  183. system.  The compilers that are produced aren't so big, but the compiler-
  184. compilers, and backend generators and the other meta-software doesn't really
  185. fit easily on a PC.  In addition to the 6 megabytes of source code on the
  186. tape, you have to count on at least 20 megabytes of object files and working
  187. space to compile everything.  The 68000 compiler has been running for years
  188. and it is pretty good.  We recently rewrote the backend table for the
  189. 68000, 68010, and 68020 and the code quality seems very good (about 15% better
  190. than the C compiler Motorola sells).  I haven't even thought about using the
  191. Pascal, Modula 2, Basic etc. front ends because I wanted the system to fit on,
  192. and be able to recompile itself on a system without, a hard disk.  This
  193. succeeded.  Technically there shouldn't be any big problem with the other
  194. front ends.  Note that UniPress has TWO packages: 8088 MINIX C compiler, and
  195. full ACK.  The former is 4 diskettes; the latter is 6 megabytes on a mag tape.
  196.  
  197.  
  198. Andy Tanenbaum (minix@cs.vu.nl, or in emergencies, minix@vu44.uucp)
  199.  
  200. Sizes of the MINIX commands
  201.  
  202.   Program  Text  Data   Bss  Total   (all sizes in decimal bytes)
  203.     sync:   424    20    26    470
  204.      clr:   714    28   156    898
  205.   update:   836    42    58    936
  206.    sleep:   848    58    58    964
  207.       ln:  1070    86    74   1230
  208.    chmod:   984    98   156   1238
  209. basename:  1060    66   156   1282
  210.      tee:  1228    82    94   1404
  211.     kill:  1240    78   156   1474
  212.   umount:   782   758    26   1566
  213.    touch:  1348    76   156   1580
  214.      sum:  1438    84   156   1678
  215.    mknod:   930   738    26   1694
  216.    mount:   890   782    26   1698
  217.      pwd:  1546    84   172   1802
  218.    mkdir:  1656   158    58   1872
  219.    split:  1656   132   130   1918
  220.      rev:   886    42  1052   1980
  221.    rmdir:  1802   196   188   2186
  222.      cat:  1212   722   540   2474
  223.       mv:  2444   244    58   2746
  224.     echo:   648    24  2076   2748
  225.     stty:  2336   260   170   2766
  226.       rm:  2468   276    30   2774
  227.       df:  2030   948   156   3134
  228.     time:  2584   666   266   3516
  229.      lpr:  1314   126  2114   3554
  230.     comm:  1822   104  2400   4326
  231.       tr:  1470    82  2852   4404
  232.    login:  3376  1436    28   4840
  233.    chmem:  3178   278  2074   5530
  234.     size:  3102   232  2208   5542
  235.      tar:  4010   456  1774   6240
  236.     head:  2762   168  3484   6414
  237.       wc:  4460   208  2104   6772
  238.       su:  3548  1498  2076   7122
  239.       dd:  4966   532  2148   7646
  240.    chown:  3522  2148  2074   7744
  241.     date:  5338   412  2104   7854
  242.       od:  5388   288  3654   9330
  243.   passwd:  4976  1764  2620   9360
  244.       pr:  5776   514  3110   9400
  245.     sort:  6404   694  2490   9588
  246.     grep:  6740   694  2208   9642
  247.     uniq:  4956   850  5150  10956
  248.       cc:  4404   826  5986  11216
  249.    cc.at:  4404   834  5986  11224
  250.     gres:  8496   768  2076  11340
  251.     tail:  4550   184  7200  11934
  252.       ar:  4900   488 11350  16738
  253.     mkfs:  8708   906  7376  16990
  254.     roff: 12742   820  4710  18272
  255.       cp:  1914   876 16412  19202
  256.     make: 15216  1976  3614  20806
  257.     shar:   980    82 20506  21568
  258.      cmp:  3372   224 18468  22064
  259.  dosread:  7440  3688 11992  23120
  260.    mined: 15680  2198  5308  23186
  261.       sh: 21536  1668  1310  24514
  262.       ls:  7164   584 17994  25742
  263.      cpp: 16896  3764  8580  29240 (Pass 1 of the C compiler)
  264.     asld: 14048  7882  7412  29342 (Pass 5 of the C compiler)
  265.      opt: 16400  9368  9494  35262 (Pass 3 of the C compiler)
  266.       cg: 24816 22968 10520  58304 (Pass 4 of the C compiler)
  267.      cem: 59856 10656  3164  73676 (Pass 2 of the C compiler)
  268.